package com.aizhixin.lab.course.template.repository;

import com.aizhixin.lab.course.template.entity.TemplateChapterFile;
import io.swagger.models.auth.In;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Set;

public interface TemplateChapterFileRepository extends JpaRepository<TemplateChapterFile, Long> {
    List<TemplateChapterFile> findByChapterIdOrderByNo(Long chapterId);
    TemplateChapterFile findByChapterIdAndNameAndDeleteFlag(Long chapterId, String name, Integer deleteFlag);
    void deleteByChapterIdIn(Set<Long> chapterIds);
    List<TemplateChapterFile> findByChapterIdIn(List<Long> chapterIds);
    TemplateChapterFile findByIdAndDeleteFlag(Long id,Integer deleteFlag);
    List<TemplateChapterFile> findByTypeAndDeleteFlag(Integer type,Integer deleteFlag);
    List<TemplateChapterFile> findByFileUrlStartingWithAndDeleteFlag(String name,Integer deleteFlag);
    Integer countByChapterIdInAndTypeAndDeleteFlag(List<Long> ids, Integer type, Integer deleteFlag);
}
